<?php

	class myDBS {

		function selectDB($dbname) {
			mysql_select_db($dbname) or die ("Don't select table");
		}

		function insData($sql) {
			mysql_query($sql);
			return mysql_insert_id();
		}

		function runSQL($sql) {
			$result = mysql_query ($sql);
			return $result;
		}

		function showData($tablename) {
			$sql = "SELECT * FROM $tablename";
			$result = mysql_query ($sql);

			return $result;
		}

		function showData1($tablename, $where) {
			$sql = "SELECT * FROM $tablename WHERE $where";
			$result = mysql_query ($sql);

			return $result;
		}

		function fetch_object ($result) {
			return mysql_fetch_object($result);
		}
		

		function delData_byID($tablename, $id) {
			$sql = "DELETE FROM $tablename WHERE id = '$id'";
			$result = mysql_query ($sql);

			return $result;
		}
	}
?>